package com.itheima.service.impl;

import com.itheima.dao.AccountDao;
import com.itheima.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {

    //注入dao
    @Autowired
    private AccountDao accountDao;

    @Override
    public void transfer(String outName, String inName, int money) {

        System.out.println("转账开始执行了");

        accountDao.out(outName,money);
        /*模拟死机 */
        //int i = 1/0;

        accountDao.in(inName,money);

    }
}
